fix(OVERPRIVILEGED_TOOL): flag shell:* namespace wildcard (silent gate bypass)#52
Open
dmchaledev wants to merge 1 commit into
Open
fix(OVERPRIVILEGED_TOOL): flag shell:* namespace wildcard (silent gate bypass)#52dmchaledev wants to merge 1 commit into
shell:* namespace wildcard (silent gate bypass)#52dmchaledev wants to merge 1 commit into
Conversation
A tool granted `shell:*` — a strict superset of `shell:exec`, i.e. full arbitrary command execution on the host — previously produced zero findings and passed the security gate, while the identical tool with `shell:exec` was correctly flagged HIGH. The rule matched dangerous permissions by exact string, so the more-permissive wildcard slipped through. OVERPRIVILEGED_TOOL now treats a dangerous namespace's wildcard (`ns:*`) as at least as dangerous as its specific dangerous permission. Wildcards owned by a dedicated rule (`filesystem:*` → UNRESTRICTED_FILE_ACCESS) are excluded to avoid double-counting; `network:*` remains explicitly listed. Adds tests for shell:* (fires), filesystem:* (no double-count), and a benign namespace wildcard (does not fire). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CgJhQmgsdSR6CguK51tv2B
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OVERPRIVILEGED_TOOLmatches dangerous permissions by exact string (DANGEROUS_PERMISSIONS = ['filesystem:write', 'network:*', 'shell:exec']). Because of this, a tool grantedshell:*— a strict superset ofshell:exec, i.e. full arbitrary command execution on the host — produces zero findings and PASSES the gate, while the identical tool withshell:execis correctly flagged HIGH.This is the "silently passes on a real risk" false-negative class: the more-permissive form of the single most dangerous permission slips through the gate.
Repro (built CLI at current
main)Characterizing the gap across the dangerous namespaces:
shell:execshell:*shell:exec, unflaggednetwork:*filesystem:*So
shell:*is the sole dangerous namespace whose wildcard was uncovered.Fix
OVERPRIVILEGED_TOOLnow treats a dangerous namespace's wildcard (ns:*) as at least as dangerous as its specific dangerous permission — a wildcard grants everything the specific permission does. To avoid double-counting the same issue (the codebase already takes this care forMISSING_TLS/INSECURE_TRANSPORT), wildcards owned by a dedicated rule (filesystem:*→UNRESTRICTED_FILE_ACCESS) are excluded;network:*stays explicitly listed.Tests
Added to
OVERPRIVILEGED_TOOL ruleinscanner.test.ts:shell:*→ fires HIGH (evidence namesshell:*)filesystem:*→ does not double-count (still owned byUNRESTRICTED_FILE_ACCESS)logging:*wildcard → does not fireFull suite: 121 passed. Build + lint clean. No regression on the bundled
examples/vulnerable-config.json(itsfilesystem:*tool still reports onlyUNRESTRICTED_FILE_ACCESS) orexamples/secure-config.json(still passes clean).🤖 Generated with Claude Code
https://claude.ai/code/session_01CgJhQmgsdSR6CguK51tv2B
Generated by Claude Code